import request from '@/utils/request'
//++++++++++++++++获取地址列表接口+++++++++++++++++++++++
export function getAddressListById(params) {
  return request({
    url: 'Region',
    method: 'get',
    params
  })
}
//++++++++++++++++优惠券接口+++++++++++++++++++++++


// 分页获取优惠券列表
export function getCouponInfoPage(params) {
  return request({
    url: 'Shop/GetCouponInfoPage',
    method: 'get',
    params
  })
}
// 新增优惠券
export function addCouponInfo(params) {
  return request({
    url: 'Shop/AddCouponInfo',
    method: 'post',
    data: params
  })
}
//删除优惠券
export function deleteCouponInfo(params) {
  return request({
    url: 'Shop/DeleteCouponInfo',
    method: 'DELETE',
    params
  })
}
//销售级别排序
export function updateCouponInfo(params) {
  return request({
    url: 'Shop/UpdateCouponInfo',
    method: 'post',
    data: params
  })
}

//获取店铺注册申请列表
export function GetSignupInfoByPage(params) {
  return request({
    url: 'Shop/GetSignupInfoByPage',
    method: 'get',
    params
  })
}
// 通过或拒绝店铺注册
export function AuditShopApply(params) {
  return request({
    url: 'Shop/AuditShopApply',
    method: 'put',
   data: params
  })
}

//获取店铺注册申请详情
export function GetSignupInfo(params) {
  return request({
    url: 'Shop/GetSignupInfo',
    method: 'get',
    params
  })
}

//++++++++++++++++促销活动接口+++++++++++++++++++++++

// 分页获取促销活动列表
export function getSalesPromotionPage(params) {
  return request({
    url: 'SalesPromotion/PageSalesPromotionResponse',
    method: 'get',
    params
  })
}

// 新增或修改促销活动
export function saveSalesPromotion(params) {
  return request({
    url: 'SalesPromotion/SaveSalesPromotion',
    method: 'post',
    data:params
  })
}
// 发布或下架促销活动
export function releaseSalesPromotion(params) {
  return request({
    url: 'SalesPromotion/ReleaseSalesPromotion',
    method: 'post',
    data:params
  })
}
// 删除促销活动
export function deleteSalesPromotion(params) {
  return request({
    url: 'SalesPromotion/DeleteSalesPromotion',
    method: 'delete',
    params
  })
}

//++++++++++++++++销售实体接口+++++++++++++++++++++++

//获取店铺列表
export function getEntityList(params) {
  return request({
    url: 'Shop/GetShopsByPage',
    method: 'get',
    params
  })
}
//根据店铺ID获取店铺详情
export function getShop(params) {
  return request({
    url: 'Shop/GetShop',
    method: 'get',
    params
  })
}
//分页获取店铺员工列表
export function getPageShopEmployee(params) {
  return request({
    url: 'Shop/PageShopEmployeeDetails',
    method: 'get',
    params
  })
}
//分页获取店铺员工列表
export function getPageShopEmployeeList(params) {
  return request({
    url: 'Shop/PageShopEmployee',
    method: 'get',
    params
  })
}
// 新增经销商
export function addEntity(params) {
  return request({
    url: 'Shop/Enter',
    method: 'post',
    data: params
  })
}

// 修改经销商
export function setEntity(params) {
  return request({
    url: 'Shop/UpdateShop',
    method: 'post',
    data: params
  })
}

// 删除
export function delEntity(params) {
  return request({
    url: 'Shop/DeleteShop',
    method: 'DELETE',
    params
  })
}
// //修改销售级别
// export function updateShopLevel(params) {
//   return request({
//       url: 'Shop/UpdateShopLevel',
//       method: 'put',
//       data: params
//   })
//   }
//++++++++++++++++销售网络接口+++++++++++++++++++++++
//获取经销商列表
export function getSaleShop(params) {
  return request({
    url: 'Biz/GetSaleShop',
    method: 'get',
    params
  })
}
//获取门店列表
export function getPurchaseShop(params) {
  return request({
    url: 'Biz/GetPurchaseShop',
    method: 'get',
    params
  })
}
//获取地址节点的配置信息
export function getBizNode(params) {
  return request({
    url: 'Biz/GetBizNode',
    method: 'get',
    params
  })
}
//配置地址节点的门店经销商
export function saveBizNode(params) {
  return request({
    url: 'Biz/SaveBizNode',
    method: 'post',
    data: params
  })
}



//++++++++++++++++售价管理接口+++++++++++++++++++++++
//获取带价格的商品列表
export function getItemsIncludeAllLevelPrice(params) {
  return request({
    url: 'ItemPrice/GetItemsIncludeAllLevelPrice',
    method: 'post',
   data:params
  })
}
// 设置商品价格
export function setItemLevelPrice(params) {
  return request({
    url: 'ItemPrice/Set',
    method: 'post',
    data: params
  })
}
//   获取某一个商品的价格列表
export function getItemLevelPrices(params) {
  return request({
    url: 'ItemPrice/GetItemPriceByItemId',
    method: 'get',
    params
  })
}
//++++++++++++++++销售级别管理接口+++++++++++++++++++++++
//获取所有销售级别
export function getAllShopLevels(params) {
  return request({
    url: 'Shop/GetAllShopLevels',
    method: 'get',
    params
  })
}


//新增销售级别
export function addShopLevel(params) {
  return request({
    url: 'Shop/AddShopLevel',
    method: 'post',
    data: params
  })
}

//销售级别排序
export function shopLevelSort(params) {
  return request({
    url: 'Shop/ShopLevelSort',
    method: 'put',
    data: params
  })
}

//修改销售级别
export function updateShopLevel(params) {
  return request({
    url: 'Shop/UpdateShopLevel',
    method: 'put',
    data: params
  })
}

//删除销售级别
export function deleteShopLevel(params) {
  return request({
    url: 'Shop/DeleteShopLevel',
    method: 'DELETE',
    params
  })
}
// ++++++++++++ 订单接口 +++++++++++++++
//获取采购订单
export function getPurchaseTradeApp(params) {
  return request({
    url: 'Trade/GetPurchaseTradeApp',
    method: 'get',
    params
  })
}
//获取采购订单（新版MNG）
export function GetPurchaseTradeMng(params) {
  return request({
    url: 'Trade/GetPurchaseTradeMng',
    method: 'get',
    params
  })
}
//获取销售订单
export function getSaleTradeApp(params) {
  return request({
    url: 'Trade/GetSaleTradeApp',
    method: 'get',
    params
  })
}
//获取销售订单（新版）
export function getSaleTradeMng(params) {
  return request({
    url: 'Trade/GetSaleTradeMng',
    method: 'get',
    params
  })
}
//获取所有订单
export function getQueryTrades(params) {
  return request({
    url: 'Trade/QueryTrades',
    method: 'get',
    params
  })
}
//获取所有售后订单
export function SearchAfterSaleTradesByPage(params) {
  return request({
    url: 'CustomerService/SearchAfterSaleTradesByPage',
    method: 'get',
    params
  })
}
// 店铺名称联想搜索功能
export function getSuggestedShops(params) {
  return request({
    url: 'CustomerService/GetSuggestedShops',
    method: 'get',
    params
  })
}

// 店铺名称联想搜索功能
export function GetStatisticalOptionsPage(params) {
  return request({
    url: 'Chart/GetStatisticalOptionsPage',
    method: 'get',
    params
  })
}